package com.yowasa.xiuxian.engine.item.lingyao;

import com.yowasa.xiuxian.annoations.Item;
import com.yowasa.xiuxian.engine.item.ItemInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ItemTypeEnum;
import com.yowasa.xiuxian.entity.enums.StageEnum;
import com.yowasa.xiuxian.exception.HandlerException;

@Item(name = "感气丹", type = ItemTypeEnum.LING_YAO, price = 10000)
public class ZhuJiDan implements ItemInterface {

    @Override
    public String desc() {
        return "仅始明之青可以使用 气感不满70提高5点气感";
    }

    @Override
    public String effect(UserBO userBO) {
        if (!userBO.getStage().equals(StageEnum.ZHU_JI.getLevel())) {
            throw new HandlerException("感气丹仅始明之青可以使用");
        }
        if (userBO.getUserAttr().getInts() >= 70) {
            throw new HandlerException("你气感已经很优秀了,感气丹已经对你没有效果");
        }
        userBO.getUserAttr().setInts(userBO.getUserAttr().getInts() + 5);
        return "你的气感获得了提升";
    }


}
